﻿/*
 * Erstellt mit SharpDevelop.
 * Benutzer: Kai Patrick
 * Datum: 01.04.2008
 * Zeit: 15:56
 * 
 * Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
 */

using System;
using System.Collections.Generic;
using System.Reflection;

using Microsoft.Scripting;
using MSAst = Microsoft.Scripting.Ast;
using Microsoft.Scripting.Actions;
using Microsoft.Scripting.Runtime;
using Microsoft.Scripting.Generation;

namespace Gamadus.Engine.Compiler.Runtime {
    class GmlBinder : ActionBinder {
        public GmlBinder(CodeContext context)
            : base(context)  {
        }

        #region ActionBinder overrides

        public override bool CanConvertFrom(Type fromType, Type toType, NarrowingLevel level) {
            return toType.IsAssignableFrom(fromType);
        }

        public override bool PreferConvert(Type t1, Type t2) {
            throw new NotImplementedException();
        }

        public override MSAst.Expression ConvertExpression(MSAst.Expression expr, Type toType) {
            return MSAst.Ast.ConvertHelper(expr, toType);
        }

        #endregion
    }
}

